<?php
/**
 * Apricot Bootstrap script
 *
 * @package Apricot
 */

/**
 * Bootstrap 
 */
require '../app/bootstrap.php';

$defaults = array(
    'app_root'            => '',
    'www_root'            => '',
    'session_namespace'   => 'Apricot',
    'default_controller'  => 'index',
    'controllers_dir'     => 'app/controllers/',
    'views_dir'           => 'app/views/',
    'models_dir'          => 'app/models/',
    'log_dir'             => 'log/',
    'default_view_engine' => 'Apricot_View_Htmldoc',
    'env'                 => 'production',
    'reporting_level'     => E_ALL,
    'display_errors'      => '1',
    'output'              => 'http',
    'cli_controller'      => 'cli',
);

$modules = array(
    'logger' => array(
        'class' => 'Apricot_Module_Logger',
        'path'  => 'Apricot/Module/Logger.php',
    ),
);

$config = new Apricot_Config('../app/config/config.ini', $defaults);

$appRoot = realpath(dirname(dirname(__FILE__)));

$config->app_root = $appRoot;
$config->expandValues('{app_root}', $appRoot);

$config->setSection('modules', $modules);

$_KERNEL = new Apricot_Kernel($config);
$request = new Apricot_RequestHttp(null, $config);

Apricot_ExceptionHandler::initHandlers($_KERNEL);

$_KERNEL->dispatch($request);
